<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">
<title>JFinal基本增删改查-Blog案例</title>
<jsp:include page="../header.jsp"></jsp:include>
	<div class="container" style="background: #FFF;">
	<div class="page-header">
	<h1>JFinal Blog CURD 案例</h1>
	</div>
		<p><a class="btn btn-primary" href="/blog/form">新增</a></p>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th>序号</th>
					<th>标题</th>
					<th>发布时间</th>
					<th>操作</th>
				</tr>
			</thead>
			<c:forEach items="${blogs }" var="b" varStatus="s">
				<tr>
					<th>${s.index+1 }</th>
					<th>${b.title }</th>
					<th>${b.publishTime }</th>
					<th><a class="btn btn-primary btn-sm" href="/blog/form?id=${b.id }">编辑</a> <a class="btn btn-danger btn-sm"
						href="/blog/delete?id=${b.id }">删除</a></th>
				</tr>
			</c:forEach>
		</table>
	</div>
	<jsp:include page="../footer.jsp"></jsp:include>
